FUNCTION DAC_BitsToWord :Word
TITLE = 'DAC_BitsToWord'
//
// This functionblock convert the 16 input bits to word
//
// Versionshistory:
// 1.0 Ersterstellung E.Dittmann

VERSION : '1.0'
AUTHOR  : 'Lenze'
FAMILY  : 'DAC'
NAME : 'bitTow'
KNOW_HOW_PROTECT

VAR_INPUT
    xBit0:                  BOOL;
    xBit1:                  BOOL;
    xBit2:                  BOOL;
    xBit3:                  BOOL;
    xBit4:                  BOOL;
    xBit5:                  BOOL;
    xBit6:                  BOOL;
    xBit7:                  BOOL; 
    xBit8:                  BOOL;    
    xBit9:                  BOOL;    
    xBit10:                 BOOL;    
    xBit11:                 BOOL;    
    xBit12:                 BOOL;    
    xBit13:                 BOOL;    
    xBit14:                 BOOL;    
    xBit15:                 BOOL;     
END_VAR

VAR
    wOut:                  WORD;
    xwOut AT wOut:         ARRAY[0..15] OF BOOL;

END_VAR

        
BEGIN
    xwOut[0] := xBit0;
    xwOut[1] := xBit1;
    xwOut[2] := xBit2;
    xwOut[3] := xBit3;
    xwOut[4] := xBit4;
    xwOut[5] := xBit5;
    xwOut[6] := xBit6;
    xwOut[7] := xBit7;
    xwOut[8] := xBit8;
    xwOut[9] := xBit9;
    xwOut[10] := xBit10;
    xwOut[11] := xBit11;
    xwOut[12] := xBit12;
    xwOut[13] := xBit13;
    xwOut[14] := xBit14;
    xwOut[15] := xBit15;

    DAC_BitsToWord := wOut;
     
END_FUNCTION



